home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / graphicgems4.lha / GemsIV / polar_decomp / Decompose.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-06  |  766 b   |  21 lines

  1. /**** Decompose.h - Basic declarations ****/
  2. #ifndef _H_Decompose
  3. #define _H_Decompose
  4. typedef struct {float x, y, z, w;} Quat; /* Quaternion */
  5. enum QuatPart {X, Y, Z, W};
  6. typedef Quat HVect; /* Homogeneous 3D vector */
  7. typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
  8. typedef struct {
  9.     HVect t;    /* Translation components */
  10.     Quat  q;    /* Essential rotation      */
  11.     Quat  u;    /* Stretch rotation      */
  12.     HVect k;    /* Stretch factors      */
  13.     float f;    /* Sign of determinant      */
  14. } AffineParts;
  15. float polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
  16. HVect spect_decomp(HMatrix S, HMatrix U);
  17. Quat snuggle(Quat q, HVect *k);
  18. void decomp_affine(HMatrix A, AffineParts *parts);
  19. void invert_affine(AffineParts *parts, AffineParts *inverse);
  20. #endif
  21.